﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Peak.Data
{
  class UpdateDb
  {
    public const string From0_2_to_0_3 =
      @"update tasks set status = 3 where status = 2;

		insert into tasks(name,category,description,created,createdby,status,storyfk,projectfk,assignedtofk)
		select name,'bug',description,created,createdby,status,storyfk,projectfk,assignedtofk from bugs;
		delete from bugs;

		insert into SprintStories(CurrentEffort,StoryPoints,remainingEffort,storyfk,sprintfk,startDate,enddate,status)
		select CurrentEffort,StoryPoints,remainingEffort,id,sprintfk,startdate,enddate,status from stories;

		update tasks set sprintstoryfk = (select id from SprintStories ts where ts.storyfk = tasks.storyfk);";
  }
}
